export type Data_DisplayObject = {
    scripts?: any[],
    id?: string,
    children?: Data_DisplayObject[]
}

export const conversationPrefab: Data_DisplayObject = {
    id: "conversationPrefab",
    scripts: [
        {scriptName: "Transform", x: 110, y: 300, rotation: 0},
        {
            scriptName: "SpriteRenderer",
            imageName: "assets/picture/conversationBg.png"
        }
    ],
    children: [
        {
            id: "nameTxt",
            children: [],
            scripts: [
                {
                    scriptName: "TextRenderer",
                    text: "LeeYushan",
                    fontSize: 18
                },
                {
                    scriptName: "Transform",
                    x: 30,
                    y: 10,
                    rotation: 0
                }
            ]
        },
        {
            id: "dialogTxt",
            children: [],
            scripts: [
                {
                    scriptName: "TextRenderer",
                    text: "李雨山是世界上最帅的人",
                    fontSize: 18
                },
                {
                    scriptName: "Transform",
                    x: 30,
                    y: 38,
                    rotation: 0
                }
            ]
        }
    ],
};

export const screenPrefab: Data_DisplayObject = {
    id: "screenPrefab",
    children: [],
    scripts: [
        {
            scriptName: "Transform",
            x: 40,
            y: 40,
            rotation: 0
        }, {
            scriptName: "TextRenderer",
            text: "",
            fontSize: 19
        }
    ]
};

export const lockPrefab: Data_DisplayObject = {
    id: "lockPrefab",
    children: [
        {
            children: [],
            scripts: [
                {
                    scriptName: "Transform",
                    x: 30,
                    y: 80,
                    rotation: 0
                },
                {
                    scriptName: "SpriteRenderer",
                    imageName: "assets/picture/1.png"
                }
            ]
        }, {
            children: [],
            scripts: [
                {
                    scriptName: "Transform",
                    x: 110,
                    y: 80,
                    rotation: 0
                },
                {
                    scriptName: "SpriteRenderer",
                    imageName: "assets/picture/2.png"
                }
            ]
        }, {
            children: [],
            scripts: [
                {
                    scriptName: "Transform",
                    x: 190,
                    y: 80,
                    rotation: 0
                },
                {
                    scriptName: "SpriteRenderer",
                    imageName: "assets/picture/3.png"
                }
            ]
        }, {
            children: [],
            scripts: [
                {
                    scriptName: "Transform",
                    x: 30,
                    y: 130,
                    rotation: 0
                },
                {
                    scriptName: "SpriteRenderer",
                    imageName: "assets/picture/4.png"
                }
            ]
        }, {
            children: [],
            scripts: [
                {
                    scriptName: "Transform",
                    x: 110,
                    y: 130,
                    rotation: 0
                },
                {
                    scriptName: "SpriteRenderer",
                    imageName: "assets/picture/5.png"
                }
            ]
        }, {
            children: [],
            scripts: [
                {
                    scriptName: "Transform",
                    x: 190,
                    y: 130,
                    rotation: 0
                },
                {
                    scriptName: "SpriteRenderer",
                    imageName: "assets/picture/6.png"
                }
            ]
        }, {
            children: [],
            scripts: [
                {
                    scriptName: "Transform",
                    x: 30,
                    y: 180,
                    rotation: 0
                },
                {
                    scriptName: "SpriteRenderer",
                    imageName: "assets/picture/7.png"
                }
            ]
        }, {
            children: [],
            scripts: [
                {
                    scriptName: "Transform",
                    x: 110,
                    y: 180,
                    rotation: 0
                },
                {
                    scriptName: "SpriteRenderer",
                    imageName: "assets/picture/8.png"
                }
            ]
        }, {
            children: [],
            scripts: [
                {
                    scriptName: "Transform",
                    x: 190,
                    y: 180,
                    rotation: 0
                },
                {
                    scriptName: "SpriteRenderer",
                    imageName: "assets/picture/9.png"
                }
            ]
        }
    ],
    scripts: [
        {
            scriptName: "Transform",
            x: 0,
            y: 0,
            rotation: 0
        },
        {
            scriptName: "SpriteRenderer",
            imageName: "assets/picture/locker_new.png"
        }
    ]
};

export function createTileMapItemPrefab(tileId: number): Data_DisplayObject {
    return {
        scripts: [
            {scriptName: "Transform", x: 0, y: 0, rotation: 0},
            {
                scriptName: "SpriteRenderer",
                imageName: `assets/tilemap/${tileId}.png`
            },
        ]
    }
}

export const backPackPrefab: Data_DisplayObject = {
    id: "backPackPrefab",
    children: [
        {
            id:"desBg",
            children: [],
            scripts: [
                {
                    scriptName: "Transform",
                    x: 0,
                    y: -82,
                    rotation: 0
                }, {
                    scriptName: "SpriteRenderer",
                    imageName: "assets/picture/description.png"
                }
            ]
        }
        ,
        {
            id: "descriptionName",
            children: [],
            scripts: [
                {
                    scriptName: "Transform",
                    x: 10,
                    y: -80,
                    rotation: 0
                }, {
                    scriptName: "TextRenderer",
                    text: "Description",
                    fontSize: 16
                }
            ]
        },
        {
            id: "description",
            children: [],
            scripts: [
                {
                    scriptName: "Transform",
                    x: 10,
                    y: -50,
                    rotation: 0
                }, {
                    scriptName: "TextRenderer",
                    text: "",
                    fontSize: 16
                }
            ]
        }
    ],
    scripts: [
        {
            scriptName: "Transform",
            x: 130,
            y: 330,
            rotation: 0
        }, {
            scriptName: "SpriteRenderer",
            imageName: "assets/picture/backPack.png"
        }
    ]
};

export const iconPrefab: Data_DisplayObject = {
    id: "iconPrefab",
    children: [],
    scripts: [
        {
            scriptName: "Transform",
            x: 10,
            y: 10,
            rotation: 0
        }, {
            scriptName: "SpriteRenderer",
            imageName: "assets/picture/iron1.png"
        }, {
            scriptName: "IconBehaviour"
        }
    ]
};

export const framPrefab: Data_DisplayObject = {
    id: "framePrefab",
    children: [],
    scripts: [
        {
            scriptName: "SpriteRenderer",
            imageName: "assets/picture/frame.png"
        },
        {
            scriptName: "Transform",
            x: 10,
            y: 10,
            rotation: 0
        }
    ]
};

export const previewPrefab:Data_DisplayObject={
    id: "previewPrefab",
    children: [],
    scripts: [
        {
            scriptName: "SpriteRenderer",
            imageName: "assets/picture/preview/chapter1.png"
        },
        {
            scriptName: "Transform",
            x: 0,
            y: 0,
            rotation: 0
        }
    ]
};

export const useBtnPrefab:Data_DisplayObject={
    id:"useBtnPrefab",
    children:[],
    scripts: [
        {
            scriptName: "SpriteRenderer",
            imageName: "assets/picture/use.png"
        },
        {
            scriptName: "Transform",
            x: 0,
            y: 0,
            rotation: 0
        }
    ]
};

export const plotPrefab:Data_DisplayObject={
    id: "plotPrefab",
    children: [],
    scripts: [
        {
            scriptName: "SpriteRenderer",
            imageName: "assets/picture/plot/start1.png"
        },
        {
            scriptName: "Transform",
            x: 0,
            y: 0,
            rotation: 0
        }
    ]
};

export const gameEndBtnPrefab:Data_DisplayObject={
    id:"gameEndBtnPrefab",
    children:[],
    scripts:[
        {
            scriptName: "SpriteRenderer",
            imageName: "assets/picture/button/btn_kill.png"
        },
        {
            scriptName: "Transform",
            x: 300,
            y: 300,
            rotation: 0
        }
    ]
};